package com.letoo.dragon.core.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;

import com.letoo.dragon.common.utils.AliyunSmsUtils;
import com.letoo.dragon.core.service.AliyunSmsService;

/**
 * 阿里云消息服务的短信操作服务接口
 * 
 * @author: dengjie
 */
@Service("aliyunSmsService")
public class AliyunSmsServiceImpl implements AliyunSmsService {

    @Value("${aliyun.sms.endpoint}")
    private String endpoint;

    @Value("${aliyun.sms.topic}")
    private String topic;

    @Value("${aliyun.sms.signName}")
    private String signName;

    @Value("${aliyun.sms.accessKeyId}")
    private String accessKeyId;

    @Value("${aliyun.sms.accessKeySecret}")
    private String accessKeySecret;

    @Override
    public void sendSms(List<String> phoneNumberArr, Map<String, String> paramStrings, String templateCode) {
        AliyunSmsUtils.sendSms(endpoint, topic, signName, accessKeyId, accessKeySecret, phoneNumberArr, paramStrings,
                templateCode);
    }

}
